var root=ui("$");
var helperOpen = require("helper/open");
var pPrice = ui("pPrice");
var pPrice2 = ui("pPrice2");
var layoutPic = ui("layoutPic");
var qqmath = require("util/qqmath");
root.setMapping({
	"pImg.source":"firstImg",
	"pPrice.text":"price",
	"pPrice2.text":"marketPrice",
	"layoutPic.tag":"id"
});
root.on("dataRefreshed", function(){
	pPrice.text = "￥"+qqmath.getDight(pPrice.text,2);
	pPrice2.text = "￥"+qqmath.getDight(pPrice2.text,2);
});

layoutPic.on("touch", function(data) {
	if (layoutPic.tag != null && layoutPic.tag != '') {
		helperOpen.open("source://view/mall/product/main.ui",{"id":layoutPic.tag,"fromPage":"qshop"});
	}
});